from django.db import models

# Create your models here.
class Menu(models.Model):
    title = models.CharField(max_length=32)
    url = models.CharField(max_length=32)


class User(models.Model):
    username = models.CharField(max_length=32)
    password = models.CharField(max_length=32)
    phone = models.CharField(max_length=32)
    roles = models.ManyToManyField('Role')
    userdetails = models.OneToOneField('Userdetail',on_delete=models.CASCADE)
    menus = models.ManyToManyField('Menu')

class Userdetail(models.Model):
    sex = models.CharField(max_length=32)
    addr = models.CharField(max_length=32)



class Role(models.Model):
    name = models.CharField(max_length=32)
